board = ['白痴','智障','傻瓜']
sw = 0
for i in range(len(board)-1):
    if sw:
        break
    user_name = input('输入用户名:')
    if board[i] in user_name:
        n = len(board[i])
        a = '*'*len(board[i])
        if user_name.count(board[i])==1:
            user_name = user_name.replace(board[i],a)
            user_list = []
            user_list.append(user_name)
            print('非法字符已替换并添加到了user_list中',user_list)
        elif user_name.count(board[i])>1:
            n = user_name.count(board[i])
            countn = 1
            while countn < n+1:
                user_name = user_name.replace(board[i],a)
                user_list = []
                user_list.append(user_name)
                countn += 1
            print('非法字符已替换并添加到了user_list中',user_list)
                
                
                
    elif board[i] not in user_name:
            user_list = []
            user_list.append(user_name)
            print(user_list)
    elif user_name == 'q' or 'Q':
            sw = 1
    i += 1        
        

        
            
